#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import student_blueprint
from api_1_0.studentResource.studentResource import StudentResource
from api_1_0.studentResource.studentOtherResource import StuAddResource, StuUpdateResource, StuDelResource, \
    AdminUpdateResource, StudentUpdatePasswordResource, StudentImgUpdateResource

api = Api(student_blueprint)


@student_blueprint.route('/student/update/<student_id>', methods=['PUT'], endpoint='StudentUpdate')
def update(student_id):
    return AdminUpdateResource.update(student_id)


api.add_resource(StudentResource, '/student/<student_id>', '/student', endpoint='student')

# 学生注册
api.add_resource(StuAddResource, '/student/add', endpoint='add_student')

# 修改学生账号信息
api.add_resource(StuUpdateResource, '/student/update', endpoint='update_student')

# 删除学生
api.add_resource(StuDelResource, '/student/delete', endpoint='delete_student')

# 修改学生密码
api.add_resource(StudentUpdatePasswordResource, '/student/update/password', endpoint='update_studentPassword')

# 修改学生头像
api.add_resource(StudentImgUpdateResource, '/student/update/img', endpoint='update_studentImg')
